package com.koala.aideddevsystemmodule.modules.uploadFile.controller;

import com.koala.aideddevsystemmodule.utils.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * Create by koala on 2022-08-22
 */
@RestController
@RequestMapping("/uploadFile")
public class UploadFileController {

    /**
     * 上传图片
     *
     * @param name  额外的参数
     * @param files 图片文件
     */
    @PostMapping("/uploadImg")
    public R uploadImg(String name, @RequestPart(value = "files", required = false) MultipartFile[] files) {
        System.out.println(files);

        return R.ok();
    }

}